<?php
/**
* filename
* 
* description
*
* 
* @author: nbxmedia <nbxmedia@163.com>
*/



 
define("ROOT_PATH", dirname(__FILE__));
$ROOT_PATH = ROOT_PATH;

//ini_set('include_path',ini_get('include_path').':'."$ROOT_PATH/libs/PEAR");
//mb_internal_encoding('UTF-8');
//init database
require("$ROOT_PATH/config.inc.php");
define('DATA_PARTION', $conf['data_part']);
define('UPLOAD_PATH', $conf['upload_path']);
if($conf['globalize'])@import_request_variables('gpc', '');
define('DB_DRIVER', $conf['db_driver']);
require("$ROOT_PATH/includes/$conf[db_driver].inc.php");
unset($dsn);


//init template functions
define('TPLDIR', ROOT_PATH.'/templates');
$tpldir = TPLDIR;
require("$ROOT_PATH/includes/core.inc.php");
if($conf['template'])require("$ROOT_PATH/includes/template.$conf[template].php");

ini_set('include_path',ini_get('include_path').PATH_SEPARATOR."$ROOT_PATH/includes/PEAR");

$EXTEND_PATH = "$ROOT_PATH/$conf[extend_path]";
define('EXTEND_PATH', $EXTEND_PATH);

//init user extend functions/classes
if($conf['extend_func'])
{
	foreach($conf['extend_func'] as $func)
	{
		$extfile = "$EXTEND_PATH/functions.$func.php";
		if(is_file($extfile))include($extfile);
	}
}


if($conf['extend_class'])
{
	foreach($conf['extend_class'] as $class)
	{
		$extfile = "$EXTEND_PATH/$class.inc.php";
		if(is_file($extfile))include($extfile);
	}
}


if($conf['gzip_output'])@ob_start("ob_gzhandler");
//$uri = explode('/', $_SERVER['QUERY_STRING']);
//$action = ($action)?$action:$uri[2];
?>